﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
        <form id="form">
            foo：<input type="text" name='fooDict["zero"]' value="foo'zero'" />
            zoo：<input type="text" name='fooDict["zero"]' value="zoo'zero'" /><br />
            bar：<input type="text" name='fooDict["zero"]' value="bar'zero'" />
            baz：<input type="text" name='fooDict["zero"]' value="baz'zero'" /><br />
            <hr />
            foo：<input type="text" name='fooDict["one"]' value="foo'one'" />
            zoo：<input type="text" name='fooDict["one"]' value="zoo'one'" /><br />
            bar：<input type="text" name='fooDict["one"]' value="bar'one'" />
            baz：<input type="text" name='fooDict["one"]' value="baz'one'" /><br />
            <input type="button" id="btn_submit" value="提交" />
        </form>
    </div>
    <script src="~/Content/js/jquery-1.8.2.js"></script>
    <script src="~/Content/js/tjzheng.js"></script>
    <script type="text/javascript">
        $("#btn_submit").click(function () {
            var objFormEntity = new FormEntity("#form");
            objFormEntity.submiting = function () {
                var objFormData = objFormEntity.formData;
                if (!objFormData['fooDict["zero"]']) {
                    alert('fooDict["zero"]');
                    return false;
                }
                if (!objFormData['fooDict["zero"]']) {
                    alert('fooDict["zero"]不能为空');
                    return false;
                }
                if (!objFormData['fooDict["zero"]']) {
                    alert('fooDict["zero"]不能为空');
                    return false;
                }
                if (!objFormData['fooDict["zero"]']) {
                    alert('fooDict["zero"]不能为空');
                    return false;
                }
                if (!objFormData['fooDict["one"]']) {
                    alert('fooDict["one"]不能为空');
                    return false;
                }
                if (!objFormData['fooDict["one"]']) {
                    alert('fooDict["one"]不能为空');
                    return false;
                }
                if (!objFormData['fooDict["one"]']) {
                    alert('fooDict["one"]不能为空');
                    return false;
                }
                if (!objFormData['fooDict["one"]']) {
                    alert('fooDict["one"]不能为空');
                    return false;
                }
                return true;
            }
            objFormEntity.submitSuccess = function (data) {
                alert(data);
            }
            //objFormEntity.submited = function () {
            //    alert("我先执行了吗");
            //}
            objFormEntity.isClearData = false;
            //objFormEntity.url = "/Home/PostParams";
            objFormEntity.url = "/Home/PostDict";
            objFormEntity.submit();
        });
    </script>
</body>
</html>
